package com.quantum.util
{
	import com.quantum.reflection.ClassObject;
	import com.quantum.reflection.MethodObject;
	import com.quantum.reflection.MetadataObject;
	import com.quantum.reflection.ReflectionAccessor;

	public class ReflectionUtils
	{

		public static function getMethodObjects(object:Object, metadataObjectName:String):Vector.<MethodObject>
		{
			var classObject:ClassObject=ReflectionAccessor.instance.reflect(object);

			var methodObjects:Vector.<MethodObject>=classObject.methodObjects;

			var values:Vector.<MethodObject>=new Vector.<MethodObject>();

			for each (var methodObject:MethodObject in methodObjects)
			{

				if (methodObject.hasMetadataObject(metadataObjectName))
				{
					values.push(methodObject);
				}

//				var tags:Vector.<String> = method.getTagArgValues(metatag, key);
//				var mi:TaggedMethodInfo;
//				if (tags.length == 0) {
//					mi = newMethodInfo( method, object );
//					
//					continue;
//				}
//				for each (var tag:String in tags) {
//					mi = newMethodInfo( method, object );
//					mi.tagValue = resolveTagValue( tag, object ) as String;
//					values.push( mi );
//				}
			}
			return values;
		}

		
		public static function getClassMetadataObjects(object:Object, metadataObjectName:String):Vector.<MetadataObject>
		{
			var classObject:ClassObject=ReflectionAccessor.instance.reflect(object);
			return classObject.getMetadataObjects(metadataObjectName);
		}
		

	}
}